package customize

import (
	"gitcode.com/G-YT/baoyou/server/global"
	"gitcode.com/G-YT/baoyou/server/model/user"
)

// HealthReport 健康报告
type HealthReport struct {
	global.GvaModel
	Uid            uint          `json:"uid" gorm:"column:uid;comment:用户ID"`
	ReportNumber   string        `json:"report_number" gorm:"column:report_number;comment:报告编号"`
	ConstitutionID uint          `json:"constitution_id" gorm:"column:constitution_id;comment:体质ID"`
	SolarTermsID   uint          `json:"solar_terms_id" gorm:"column:solar_terms_id;comment:节气ID"`
	DiseaseTypeIDs string        `json:"disease_type_ids" gorm:"column:disease_type_ids;comment:病症类型ID集合"`
	DiseaseIDs     string        `json:"disease_ids" gorm:"column:disease_ids;comment:病症ID集合"`
	User           *user.User    `json:"-" form:"-" gorm:"->;foreignKey:Uid;references:ID;"`            // 关联用户
	Physique       *Constitution `json:"-" form:"-" gorm:"->;foreignKey:ConstitutionID;references:ID;"` // 关联体质
	SolarTerms     *SolarTerms   `json:"-" form:"-" gorm:"->;foreignKey:SolarTermsID;references:ID;"`   // 关联节气
	Disease        *Disease      `json:"-" form:"-" gorm:"->;foreignKey:DiseaseIDs;references:ID;"`     // 关联病症
}

// HealthPlan 健康方案
type HealthPlan struct {
	global.GvaModel
	DrrID       uint   `json:"drr_id" gorm:"column:drr_id;comment:病症报告记录ID"`
	Types       int    `json:"types" gorm:"column:types;comment:1脑波方案2运动方案3体质茶 4您的配餐 5千预方案"`
	IDs         string `json:"ids" gorm:"column:ids;comment:文章方案"`
	ArticleType int    `json:"article_types" gorm:"column:article_types;comment:文章类型 1图文2音频 3视频"`
	Content     string `json:"content" gorm:"column:content;comment:干预方案;type:text"`
	Money       uint   `json:"money" gorm:"column:money;comment:金额"`
}

func (HealthReport) TableName() string { return "by_health_report" }

func (HealthPlan) TableName() string { return "by_health_plan" }
